package com.crm.jdy.service.drp;

import com.crm.jdy.common.dto.WOrderInfoDto;
import com.crm.jdy.common.mapper.FRecordInfoMapper;
import com.crm.jdy.common.pojo.TeamInfo;
import com.crm.jdy.common.pojo.WOrderInfo;
import com.crm.jdy.common.mapper.WOrderInfoMapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.apache.dubbo.config.annotation.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

/**   
 * @Description:(采购订单列表信息服务实现)
 *
 * @version: V1.0
 * @author: kong
 * 
 */
@Service(version = "${service.version}")
@Component
public class WOrderInfoServiceImpl  extends ServiceImpl<WOrderInfoMapper,WOrderInfo> implements WOrderInfoService  {


    @Autowired
    WOrderInfoMapper wOrderInfoMapper;





    @Override
    public PageInfo<WOrderInfo> seleteWOrderInfo(WOrderInfoDto wOrderInfoDto) {
        PageHelper.startPage( wOrderInfoDto.getCurrentPage(),wOrderInfoDto.getPageSize());
        List<WOrderInfo> bookList = wOrderInfoMapper.seleteWOrderInfo(wOrderInfoDto);
        PageInfo<WOrderInfo> pageInfo = new PageInfo<WOrderInfo>(bookList);
        return pageInfo;
    }

    @Override
    public boolean updateWOrderInfo(WOrderInfo wOrderInfo) {
        return wOrderInfoMapper.updateById(wOrderInfo) > 0;
    }

    @Override
    public boolean addWOrderInfo(WOrderInfo wOrderInfo) {
        return wOrderInfoMapper.insert(wOrderInfo) > 0;
    }

    @Override
    public boolean removeWOrderInfo(String orderId) {
        return wOrderInfoMapper.deleteById(orderId) > 0;
    }
}